<script>
	export default {
		onLaunch: function() {
			console.log('App Launch')
			uni.$on('updateLanguage', this.updateTabBarText);
		},
		onShow: function() {
			console.log('App Show')

		},
		onHide: function() {
			console.log('App Hide')
		},
		methods: {
			updateTabBarText() {
				console.log('全局监听 语言修改 刷新tabbar');
				uni.setTabBarItem({ index: 0, text: this.$t('tabbar.business') });
				uni.setTabBarItem({ index: 1, text: this.$t('tabbar.message') });
				uni.setTabBarItem({ index: 2, text: this.$t('tabbar.mine') });
			}
		},
		beforeDestroy() {
			uni.$off('updateLanguage'); // 避免内存泄漏
		}
	}
</script>

<style>
	/*每个页面公共css */
	body {
		background-color: #f5f5f5;
	}

	page {
		background-color: #f5f5f5;
		height: 100%;
	}
</style>